package task13;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 10:36
 * @description:
 */
public class PrinterFactory {

  public Printer getPrinter(int a) {
    Printer printer = null;
    if (a == 0) {
      printer = new HPrinter();

    } else if (a == 1) {
      printer = new CPrinter();

    } else {
      System.out.println("输入有误");
    }
    return printer;
  }
}

